how to return a table from function in postgresql